/**
 * 
 */
package com.zhbit.dao;

import java.util.List;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;

import com.zhbit.domain.User;

/**
 * @author Administrator
 * 
 */
public class UserDaoImpl implements UserDao {
	@Resource
	private SessionFactory sessionFactory;

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.zhbit.bbs.dao.UserDao#insertUser(com.zhbit.bbs.domain.User)
	 */
	@Override
	public User insertUser(User user) {
		sessionFactory.getCurrentSession().persist(user);

		return user;

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.zhbit.bbs.dao.UserDao#updateUser(com.zhbit.bbs.domain.User)
	 */
	@Override
	public User updateUser(User user) {
		sessionFactory.getCurrentSession().merge(user);
		return user;

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.zhbit.bbs.dao.UserDao#deleteUser(com.zhbit.bbs.domain.User)
	 */
	@Override
	public void deleteUser(User user) {
		// TODO Auto-generated method stub

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.zhbit.bbs.dao.UserDao#selectUser(java.lang.String)
	 */
	@Override
	public List searchUser(String whereSql) {
		// TODO Auto-generated method stub
		return null;
	}

}
